<?
use WID\Test\Matchers as Matchers;

class toBeInstanceOfTestClass {}

return array(
	'name'=>'toBeInstanceOf', 
	
	'each'=> array(
		'matcher'=>null
	),
	
	'beforeEach'=>function(&$each) {
		$each['matcher'] = new Matchers\toBeInstanceOf();
	}, 
	
	'tests'=>array(
		'match'=>function(&$each) {
			$m = $each['matcher'];
			$obj = new toBeInstanceOfTestClass();
			$this->expect($m->match($obj,false,'toBeInstanceOfTestClass'))->toBeTrue(); // prawdziwy
			$this->expect($m->match($obj,true,'Exception'))->toBeTrue(); // zanegowny prawdziwy
			$this->expect($m->match($obj,true,'toBeInstanceOfTestClass'))->toBeFalse(); // zanegowany nieprawdziwy
		},
		
		'getInfo'=>function(&$each) {
			$obj = new toBeInstanceOfTestClass();
			$ser = serialize($obj);
			$this->expect($each['matcher']->getInfo($obj,false,'A'))->toBe('|'.$ser.'| to be instance of A');
			$this->expect($each['matcher']->getInfo($obj,true,'toBeInstanceOfTestClass'))
				->toBe('|'.$ser.'| not to be instance of toBeInstanceOfTestClass');
		},
		
		'getName'=>function(&$each) {
			$this->expect($each['matcher']->getName())->toBe('toBeInstanceOf');
		}
		
	)
);
?>